package com.ggs.rg.ybjb.usermodule.util;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ggs.rg.ybjb.pojomodule.pojo.TAddress;

import java.util.ArrayList;
import java.util.List;

/**
 * ClassName:AddressUtil
 * Package:com.ggs.rg.ybjb.usermodule.util
 * Description:
 *
 * @Date:2021/11/23 17:41
 * @Author:cxw
 */
public class AddressUtil {

    public static List<JSONObject> addressForJson(List<TAddress> addressList){
        List<JSONObject> lists = new ArrayList<>();
        for (TAddress address:addressList){
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("aid",address.getAid());
            jsonObject.put("address",address.getAddress());
            jsonObject.put("consigneeName",address.getConsigneeName());
            jsonObject.put("consigneePhone",address.getConsigneePhone());
            lists.add(jsonObject);
        }
        return lists;
    }

}
